package com.bwie.controller;

import com.bwie.param.OrderParam;
import com.bwie.service.TbOrderService;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/order")
public class OrderController {
    @Autowired
    private TbOrderService tbOrderService;
    /**
     * 获取订单列表
     */
    @PostMapping("/getOrderList")
    public R getOrderList(@RequestBody OrderParam orderParam){
        return tbOrderService.getOrderList(orderParam);
    }
    /**
     * 修改订单状态
     */
    @PostMapping("/updateStatus/{orderId}")
    public R updateStatus(@PathVariable(name = "orderId")Integer orderId){
        return tbOrderService.updateStatus(orderId);
    }
    /**
     * 修改订单库存
     */
    @PostMapping("/updateNum/{orderId}")
    public R updateNum(@PathVariable(name = "orderId")Integer orderId){
        return tbOrderService.updateNum(orderId);
    }
}
